package com.lyf.scm.admin.domain.remote.allocationservice;

import com.github.pagehelper.PageInfo;
import com.lyf.scm.admin.api.dto.SalesPlanDirectlyDTO;
import com.lyf.scm.admin.api.dto.DirectlyExecuteInfoDTO;
import com.lyf.scm.admin.api.dto.DirectlyExecuteDTO;
import com.rome.arch.core.clientobject.Response;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * description:
 *         直营预测计划--执行
 * @author: haodong
 * @data: 2020/8/5 13:45
 */
@FeignClient(name = "scm-plan-service")
public interface DirectlyExecuteRemote {

    @PostMapping("/api/v1/salesPlanDirectlyExecute/list")
    Response<PageInfo<DirectlyExecuteInfoDTO>> listBySelective(@RequestBody DirectlyExecuteDTO salesPlanDirectlyExecute);

    @PostMapping("/api/v1/salesPlanDirectlyExecute/listAll")
    Response<List<DirectlyExecuteInfoDTO>> listAllByDays(DirectlyExecuteDTO salesPlanDirectlyExecute);

    /**
     * 导出Excel
     *
     * @param directly
     * @param type
     * @return
     */
    @PostMapping(value = "/api/v1/salesPlanDirectlyExecute/export", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
    feign.Response exportExcel(@RequestBody DirectlyExecuteDTO directly, @RequestParam("type") Integer type);

    /**
     * 删除直营预测——执行对应标识数据
     *
     * @param opSign
     * @return
     */
    @PostMapping("/api/v1/salesPlanDirectlyExecute/delete")
    Response delete(@RequestParam("opSign") String opSign);
}
